/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var EmpresaModal ={
    pesquisar: function(param){
        Action.setUrl('empresa/listar-modal')
		      .setParam(param)
                      .setDataType('html')
                      .setCallback(function(html){$('#div_listar_modal').html(html);})
                      .postar();	
    },
    
    buscarEmpresaModal:function(id){
        Action.setUrl('empresa/cadastro-modal')
		      .setParam({id:id})
                      .setDataType('html')
                      .setCallback(function(html){
                          $('#content_sys_modal').html(html);
                      })
                      .postar();	
    },
    
    buscarEmpresaModalJson:function(id,callback){
        Action.setUrl('empresa/buscar-empresa-json')
		      .setParam({id:id})
                      .setDataType('json')
                      .setCallback(callback)
                      .postar();	
    },
   
    salvar:function(param,callbackSucces){
       Action.setUrl('empresa/salvar-cadastro')
		      .setParam(param)
		      .setDataType('json')
		      .setCallback(function(json){
                           jAlert(json.retorno,'Alerta');
                           if(json.resultado == Config.OK && callbackSucces != undefined){
                               callbackSucces();
                           }
                       })
		      .postar();	
    }, 
    
     
    buscarModalEmpresaModal:function(callback,id){
        Action.setUrl('empresa/iniciar-modal')
		      .setParam({id:id})
                      .setDataType('html')
                      .setCallback(function(html){
                            callback(html);
                      })
                      .postar();	
    }    
};

